<template>
	<div style="background-color: #f6f6f6;">
		<top-nav bgColor="white" title="授权单"  btnName="授权"  :rightShow="true" returnPath="factoryList" rightPath="demoOrderListForAddBill" @fatherDo="goAddBills"></top-nav>
		
		<div style="width: 100%;height: 3rem;"></div>
		<card-item v-for="item in list" 
			:key ="item"
			:goodsNumber="item.BillNo"
			:customerInfo="item.BusinessUnit.Name"
			:plateNumber="item.CarNumber"
			:ladingCode="item.PassWord"
			:remarks="item.PassWord"
			:materiel="item.ItemName"
			:fid="item.FID"
			:PreLoad="item.PreLoad"
			@sendParam="sendNextParam(item)"></card-item>
	</div>
</template>

<script>
	 import TopNav from '@/components/nav/topNav.vue'
	 import CardItem from '@/page/project/demo/cardItem/cardItem.vue'
	 export default {
		components: {
		      TopNav,
		      CardItem
		},
		data(){
			return{
				list:[],
				uid:'',
				factoryInfo:{}
			}
		},
		mounted(){
			this.factoryInfo=JSON.parse(localStorage.factoryInfo)
			console.info(this.factoryInfo)
			this.getAllTask()
		},
		methods:{
			getAllTask(){
				let that=this
				that.axios.post('/demo/getAllTask',{
					'factoryId':localStorage.factoryId,
					'uid':localStorage.uid,
					'currentpage':1
				}).then(function(response){
					console.info(response.data.data)
					that.list=response.data.data.list
				}).catch(function(error){
					
				})
			},
			goAddBills(){
				let that=this
				that.$router.push({
					path:'/demoOrderListForAddBill'
				})
			},
			sendNextParam(data){
				let that=this
				that.$router.push(
			 		{
			 			path:'demoOrderDetail',
			 			name:'demoOrderDetail',
//					 params: { 
//						goodsNumber:that.goodsNumber,
//		                plateNumber:that.plateNumber,
//		                customerInfo:that.customerInfo,
//		                remarks:that.remarks,
//		                materiel:that.materiel,
//		                PreLoad:that.PreLoad,
//		                ladingCode:that.ladingCode,
//		                quantity:that.quantity,
//		                orderid:that.id,
//		                fid:that.fid
//			           }
					 params:{
					 	bill:data
					 }
					 })
			}
		}
	 }
</script>

<style>
</style>